// $Id: text_decoding.h 28 2015-03-11 01:53:12Z robim.poa@gmail.com $
//-----------------------------------------------------------------------------
// Purpose: Text reading and decoding.
// $Rev: 28 $
// $Author: robim.poa@gmail.com $
// $Date: 2015-03-11 01:53:12 +0000 (Wed, 11 Mar 2015) $

#ifndef TEXT_DECODING_H
#define TEXT_DECODING_H

#define OPERATOR_NONE 0
#define LOGIC_OPERATOR_OR 1
#define LOGIC_OPERATOR_AND 2
#define LOGIC_OPERATOR_NOT 3
#define COMPARISON_OPERATOR_EQUAL 4
#define COMPARISON_OPERATOR_NEQUAL 5
#define COMPARISON_OPERATOR_GREATER 6
#define COMPARISON_OPERATOR_LESS 7
#define COMPARISON_OPERATOR_GREATER_EQUAL 8
#define COMPARISON_OPERATOR_LESS_EQUAL 9
#define ARITHMETIC_OPERATOR_EQUAL 10
#define ARITHMETIC_OPERATOR_PLUS 11
#define ARITHMETIC_OPERATOR_MINUS 12
#define ARITHMETIC_OPERATOR_MULTI 13
#define ARITHMETIC_OPERATOR_DIVIS 14
#define ARITHMETIC_OPERATOR_MODULO 15
#define ARITHMETIC_OPERATOR_INCREMENT 16
#define ARITHMETIC_OPERATOR_DECREMENT 17
#define ARITHMETIC_OPERATOR_POWER 18
#define BRACKETS_PARENTHESES_OPEN 19
#define BRACKETS_PARENTHESES_CLOSE 20
#define BRACKETS_SQUARE_OPEN 21
#define BRACKETS_SQUARE_CLOSE 22
#define BRACKETS_BRACES_OPEN 23
#define BRACKETS_BRACES_CLOSE 24
#define SYNTAX_MARK_SEMICOLON 25

#define STATEMENT_NONE        0
#define STATEMENT_WHILE       1
#define STATEMENT_IF          2
#define STATEMENT_ELSE        9
#define STATEMENT_FOR         3
#define STATEMENT_SWITCH      4
#define STATEMENT_TYPE_INT    5
#define STATEMENT_TYPE_FLOAT  6
#define STATEMENT_TYPE_CHAR   7
#define STATEMENT_TYPE_DOUBLE 8

char tdGetNonBlankChar(FILE *pfile);

void tdGetString(char *str, FILE *pfile);

int tdGetOperator(char *str, FILE *pfile);

int tdStringToOperator(char* buffer);

int tdIsNumber(char* str);

int tdStrToInt(char *str);

char tdLookNextChar(FILE* pfile);

char tdGetChar(FILE* pfile);

void tdLookNextString(char *str, FILE *pfile);

int tpStringToStatement(char* buffer);

int tdGetLine(FILE *pfile);

int tdEndOfFile(FILE *pfile);

#endif